Version

ApplyTo(WorksheetRegion[]) Method

Applies the formula to all specified regions of cells.
Syntax
'Declaration
 
Public Overloads Sub ApplyTo( _
   ByVal regions() As WorksheetRegion _
) 
public void ApplyTo( 
   WorksheetRegion[] regions
)

Parameters

regions
The regions of cells to apply the formula to.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionregions is null.
System.ArgumentExceptionregions has a length of 0.
System.ArgumentException Not all regions specified are from the same worksheet.
System.InvalidOperationException One or more regions specified contain array formulas or data tables which extend outside the region.
Remarks

This method, or one of the other ApplyTo overrides must be used to set the value of a cell to a formula.

After this method returns, the WorksheetCell.Formula of all cells in all specified regions will return the formula.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also